function run(script)
   
  if (nargin != 1)
    print_usage ();
  endif

  [d, f, ext] = fileparts (script);
  if (! isempty (d))
    if (exist (d, "dir"))
      wd = pwd ();
      unwind_protect
        cd (d);
        #hie
        if (! exist (cstrcat (f, ext), "file"))
          error ("run: file SCRIPT must exist and be a valid Octave scriptfile");
        endif
        evalin ("caller", sprintf ("source (\"%s%s\");", f, ext),
                "rethrow (lasterror ())");
      unwind_protect_cleanup
        cd (wd);
      end_unwind_protect
    else
      error ("run: the path %s doesn't exist", d);
    endif
  else
    if (exist (script, "file"))
      evalin ("caller", sprintf ("source (\"%s\");", script),
              "rethrow (lasterror ())");
    else
      error ("run: %s not found", script);
    endif
  endif
   

/*
@GROUP
engine
@SYNTAX
run(script)
@DOC
this is the basic command for using the "engine" of JMathLib
@EXAMPLES
<programlisting>
</programlisting>
@NOTES
@SEE
*/
